package junior.db.spi;

import junior.db.dao.update.BatchInsertOption;
import junior.db.dao.update.BatchUpdateOption;
import junior.db.dao.update.BatchUpsertOption;
import junior.db.dao.update.DeleteOption;
import junior.db.dao.update.InsertOption;
import junior.db.dao.update.UpdateOption;
import junior.db.dao.update.UpsertOption;

/**
 * @author wubo
 * @date 2024/9/2 16:27
 */
public interface EntityPersistenceService {
    
    void beforeInsert(Object entity);
    
    void beforeUpdate(Object entity);
    
    String[] getExcludeInsertFields(Object entity);
    
    String[] getExcludeUpdateFields(Object entity);
    
    default BatchInsertOption getBatchInsertOption(Class<?> entityClass) {
        return new BatchInsertOption();
    }
    
    default InsertOption getInsertOption(Class<?> entityClass) {
        return new InsertOption();
    }
    
    default UpsertOption getUpsertOption(Class<?> entityClass) {
        return new UpsertOption();
    }
    
    default UpdateOption getUpdateOption(Class<?> entityClass) {
        return new UpdateOption();
    }
    
    default DeleteOption getDeleteOption(Class<?> entityClass) {
        return new DeleteOption();
    }
    
    default BatchUpsertOption getBatchUpsertOption(Class<?> entityClass) {
        return new BatchUpsertOption();
    }
    
    default BatchUpdateOption getBatchUpdateOption(Class<?> entityClass) {
        return new BatchUpdateOption();
    }
    
}
